{% extends base %}

{% block body %}

{% init plugin_categories = [] %}

<div class="card">
    <div class="card-title">
        <span>插件中心</span>

        {% if _is_admin %}
            <div class="float-right">
                <a class="btn btn-default" href="/plugins_new">新增</a>
                <a class="btn btn-default" href="/fs_link/scripts/plugins">管理</a>
                <a class="btn btn-default" href="/fs_api/download/plugins">下载</a>
                <a class="btn btn-default" href="/plugins_list_old">旧版工具箱</a>
            </div>
        {% end %}

    </div>
</div>

{% if _is_admin %}

    <div class="transparent-card card hide">
        <h3 class="card-title">操作</h3>

        <a class="btn" href="/plugins_new">新增</a>
        <a class="btn" href="/fs_link/scripts/plugins">管理</a>
        <a class="btn" href="/fs_api/download/plugins">下载</a>
        
        <div class="float-right">
            <a class="btn" href="/plugins_list_old">返回旧版</a>
        </div>
    </div>
{% end %}

<div class="plugin-list col-md-12">
    {% for temp_category, plugins in plugin_categories %}
        {% if len(plugins) == 0 %}
            {% continue %}
        {% end %}
        <div class="card">
            <h3 class="card-title">{{temp_category}}</h3>
            {% for item in plugins %}
                <span class="tag-span">
                    <a href="{{item.link}}">{{item.title}}</a>
                </span>
            {% end %}
        </div>
    {% end %}
</div>
{% end %}

